unit PDFView;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, dRoot, DB, StdCtrls, Buttons, ExtCtrls, ComCtrls, PdfViewer;

type
  TfmPDFView = class(TdlgRoot)
    PdfViewer1: TPdfViewer;
    procedure FormCreate(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  fmPDFView: TfmPDFView;

implementation
uses dbinv, invtypes, invproc, shlobj;
{$R *.dfm}

procedure TfmPDFView.FormCreate(Sender: TObject);
begin
  inherited;
  ;
end;

procedure TfmPDFView.FormShow(Sender: TObject);
var filename: string;
begin
  inherited;

  filename := GetSpecialPath(CSIDL_PERSONAL) + '\scan_request_view.pdf';
  (dlgDS.DataSet.FieldByName('pdf') as TBlobField).SaveToFile(filename);
  PdfViewer1.FileName := filename;

end;

end.

